package com.hbnu.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hbnu.system.model.entity.Porproject_registration;
import com.hbnu.system.model.entity.User;
import com.hbnu.system.model.query.PorProjectExportQuery;
import com.hbnu.system.model.query.PorProjectPageQuery;
import com.hbnu.system.model.vo.ExportPorProjectVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  纵向项目登记 Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2023-05-16
 */
public interface Porproject_registrationMapper extends BaseMapper<Porproject_registration> {

    /**
     * 校级管理员查看所有相关纵向项目（分页查询）
     *
     * @param page 分页对象
     * @param query 查询条件封装对象
     * @param user 当前用户信息
     * @return 分页结果
     */
    IPage<Porproject_registration> schoolGetRelatePorprojectQuery(
            @Param("page") Page<Porproject_registration> page,
            @Param("porProjectPageQuery") PorProjectPageQuery query,
            @Param("user") User user
    );


    /**
     * 普通用户查看自己相关的纵向项目（分页查询）
     *
     * @param page 分页对象
     * @param query 查询条件封装对象
     * @param user 当前用户信息
     * @return 分页结果
     */
    IPage<Porproject_registration> schoolExportRelatePorprojectQuery(
            @Param("page") Page<Porproject_registration> page,
            @Param("porProjectPageQuery") PorProjectPageQuery query,
            @Param("user") User user
    );

    IPage<Porproject_registration> collegeGetRelatePorprojectQuery(
            @Param("page") Page<Porproject_registration> page,
            @Param("porProjectPageQuery") PorProjectPageQuery query,
            @Param("user") User user
    );

    IPage<Porproject_registration> collegeExportRelatePorprojectQuery(
            @Param("page") Page<Porproject_registration> page,
            @Param("porProjectPageQuery") PorProjectPageQuery query,
            @Param("user") User user
    );

    IPage<Porproject_registration> userGetRelatePorprojectQuery(
            @Param("page") Page<Porproject_registration> page,
            @Param("porProjectPageQuery") PorProjectPageQuery query,
            @Param("user") User user
    );

    IPage<Porproject_registration> userExportRelatePorprojectQuery(
            @Param("page") Page<Porproject_registration> page,
            @Param("porProjectPageQuery") PorProjectPageQuery query,
            @Param("user") User user
    );

    // 校级管理员导出纵向项目
    List<ExportPorProjectVO> schoolExportPorProject(
            @Param("porProjectExportQuery") PorProjectExportQuery exportQuery,
            @Param("user") User user
    );

    // 普通用户导出纵向项目
    List<ExportPorProjectVO> userExportPorProject(
            @Param("porProjectExportQuery") PorProjectExportQuery exportQuery,
            @Param("user") User user
    );
    
    // 院级管理员导出纵向项目
    List<ExportPorProjectVO> collegeExportPorProject(
            @Param("porProjectExportQuery") PorProjectExportQuery exportQuery,
            @Param("user") User user
    );
}
